package util.AST.Comando;

import java.util.ArrayList;

import checker.SemanticException;
import checker.Visitor;

import util.AST.Terminal.ID;
import util.AST.Terminal.Valor;

public class Parametros extends DecFuncao {
	
	private ArrayList<ID> listaPar;

	public ArrayList<ID> getListaPar() {
		return listaPar;
	}

	public Parametros (ArrayList<ID> arg){
		this.listaPar = arg;
	}
	
	public String toString(int level) {
		int nextLevel = level+5;
		StringBuffer str = new StringBuffer();
		str.append("Args\n");
		if ( this.listaPar != null ) {
			
			for (Valor param : this.listaPar) {
				str.append(super.getSpaces(nextLevel+5) + "|-");
				str.append(param.toString(nextLevel+5));
			}
		}
		
		return str.toString();
	}

	public Object visit(Visitor v, Object o) throws SemanticException {
		return v.visitParametros(this, o);
	}
}
